#include "mainwindow.h"

#include <QApplication>

#include <QTextStream>
#include <QThread>
#include "p2pmessager.h"
void test(QObject *messager){
    qDebug()<<"ready!!!";
    P2PMessager::get_instance().send("{\n    \"msg\": \"hello\",\n    \"type\": \"aaa\"\n}");
//    QThread::msleep(3000);
}
int main(int argc, char *argv[])
{


    QApplication a(argc, argv);
    P2PMessager& messager=P2PMessager::get_instance();

    messager.ready(test);

    // socket 的监听程序在mainwindow.cpp中无法启动，所以放在main中。


    MainWindow w;
    w.show();
    return a.exec();
}
